package com.wangyk.rabbitmqconsole.controller;

import com.wangyk.rabbitmqcommon.model.console.User;
import com.wangyk.rabbitmqconsole.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
@RequestMapping("/userpro")
public class UserProController
{
    @Autowired
    private UserService userService;

    @RequestMapping("/select_by_user_id.do")
    @ResponseBody
    public User selectByUserId(Integer userId)
    {
        User user=userService.selectUserById(userId);
        try
        {
            Thread.sleep(1000);
        }
        catch (InterruptedException e)
        {
            e.printStackTrace();
        }
        return user;
    }

    @RequestMapping("/test_ribbon.do")
    @ResponseBody
    public User testRibbon()
    {
        User user=userService.selectUserById(2);
        return user;
    }
}
